

MAX_INVENTORIES = 7; --How many inventories the player can have.  You can cautiously up this.  But beware of performance issues if this goes too high.
MAX_INV_WIDTH = 6; --Max slots an inventory can have horizontally
MAX_INV_HEIGHT = 6; --Max slots an inventory can have vertically


--Used by server side and client side to verify the character create fields are good.
function CharacterCreateValidFields( ply, name, age, desc, model )

	if( string.len( name ) < 7 ) then 
	
		return false, "Name too short";
	
	end
	
	if( string.len( name ) > 35 ) then
	
		return false, "Name too long";
	
	end
	
	if( not tonumber( age ) ) then
	
		return false, "Age not valid";
	
	end
	
	if( tonumber( age ) < 16 ) then
	
		return false, "Age cannot be under 16";
	
	end
	
	if( tonumber( age ) > 67 ) then
	
		return false, "Age cannot be over 67";
	
	end
	
	if( string.len( string.gsub( desc, " ", "" ) ) < 10 ) then
	
		return false, "Physical Description must be 10 characters or over";
	
	end
	
	if( string.len( desc ) > 50 ) then
	
		return false, "Physical Description must be under 50 characters";
	
	end
	
	local playerflags = "";
	
	if( SERVER ) then
	
		playerflags = ply:GetPlayerFlags();
	
	else
	
		playerflags = ClientVars["PlayerFlags"];
	
	end
	
	for k, v in pairs( PlayerGroups ) do
	
		if( v.Default or string.find( playerflags, v.FlagsRequired ) ) then
		
			if( table.HasValue( v.Models, string.lower( model ) ) ) then
			
				return true;
			
			end
		
		end
	
	end
	
	return false, "Invalid model";

end


